package br.com.rglariguet.pioneer.batch;

import java.text.SimpleDateFormat;
import java.util.Calendar;

import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersBuilder;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class RunScheduler {

//	@Autowired
//	private JobLauncher jobLauncher;

//	@Autowired
//	@Qualifier("dadosMestreJob1")
//	private Job job;

	public void run() {
		try {
			String minutoSegundo = new SimpleDateFormat("HH:mm:ss").format(Calendar.getInstance().getTime());
			JobParameters param = new JobParametersBuilder().addString("##### REPORT JOB >>>>>>>>>>> ", minutoSegundo).toJobParameters();
//			System.out.println(minutoSegundo);
//			JobExecution execution = jobLauncher.run(job, param);
//			System.out.println("##### REPORT JOB STATUS >>>>>>>>>>> " + execution.getStatus());
		} catch (Exception e) {
			e.printStackTrace();
		}

	}
}